import requests
import json
url = 'http://localhost/api/sjlr.php'
#body = {"time":i}
#headers = {'content-type': "application/json", 'Authorization': 'APP appid = 4abf1a,token = 9480295ab2e2eddb8'}
#print type(body)
#print type(json.dumps(body))
# 这里有个细节，如果body需要json形式的话，需要做处理
# 可以是data = json.dumps(body)
#response = requests.post(url, data = json.dumps(body))
# 也可以直接将data字段换成json字段，2.4.3版本之后支持
for i in range(2011,2022):
    #print(i)
    response  = requests.post(url, json = {"time":i})
# 返回信息
    print (i,response.text)
